//
//  CategoryModel.m
//  NekaPrice
//
//  Created by yu on 2018/6/25.
//  Copyright © 2018年 ma c. All rights reserved.
//

#import "CategoryModel.h"
#import "CategoryListModel.h"
@implementation CategoryModel

+ (CategoryModel *)ModelWithDic:(NSDictionary *)dic {
    return [[CategoryModel alloc] initWithDic:dic];
}

- (instancetype)initWithDic:(NSDictionary *)dic {
    if (self = [super init]) {
        _name = dic[@"typename"];
        NSArray *list = dic[@"category_list"];
        NSMutableArray *mutlist = [NSMutableArray new];
        for (NSDictionary *dic in list) {
            CategoryListModel *model = [CategoryListModel ModelWithDic:dic];
            [mutlist addObject:model];
        }
        _categoryList = [NSArray arrayWithArray:mutlist];
    }
    return self;
}

- (void)setValue:(id)value forUndefinedKey:(nonnull NSString *)key {
    
}

@end
